package com.mad.game.view;

import java.awt.*;
import javax.swing.*;

import com.mad.game.system.GameSystem;

public abstract class DefaultWnd extends JFrame {

	private static final long serialVersionUID = 1L;

	private String title ; 
	private Dimension size ; 
	
	public DefaultWnd(final String title, final int width, final int height) {
		this.title = title ; 
		this.size = new Dimension(width, height); 
		this.init(); 
	}
	
	protected void init(){
		this.setDefaultCloseOperation(EXIT_ON_CLOSE); 
		this.setTitle(this.title);
		this.setSize(size);
		this.setLocation(GameSystem.centerToScreen(size)); 
	}

	protected void makeVisible(){
		this.setVisible(true);
	}
	
	protected void makeInvisible(){
		this.setVisible(false); 
	}
	
}
